package cn.edu.stu.syllabus.repository.token;

import cn.edu.stu.syllabus.repository.token.local.TokenEntry;
import cn.edu.stu.syllabus.repository.token.remote.Token;

/**
 * Created by daidaijie on 2017/4/24.
 */

public class TokenConverter {

    public static TokenEntry convert(Token token) {
        TokenEntry tokenEntry = new TokenEntry();
        tokenEntry.setStartTime(System.currentTimeMillis());
        tokenEntry.setAccessToken(token.getAccess_token());
        tokenEntry.setRefreshToken(token.getRefresh_token());
        tokenEntry.setExpressTime(token.getExpires_in());
        return tokenEntry;
    }
}
